• From , drag Set y Speed inside the space_bar() event.
  • Replace the number in the .set_y_speed() command with down_count.
  • Change the name in front of the command to ball.

Now the ball's y speed is set to the number of times the down key was pressed (the value of down_count).

  • Test your code by clicking Run and using the left arrow key, down arrow key, and space bar to shoot the ball.

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)